package util.rm.quml.gemom;

import inl.resilienceManager.qmul.gemom.TableSaver;
import inl.resilienceManager.qmul.gemom.varTable;

/*
 * COPYRIGHT DISCLAIMER
 * Synopsis: All the source codes presented in this document are intellectual
 * properties of Queen Mary, University of London.
 * 
 * @year 2010
 * @author Peng Jiang, John Bigham, Jiayi Wu Jinfu Wang------------QMUL
 * @version 1.0 
 */

public class BuildDataTables {
	CovMatrixData cmdata;
	public BuildDataTables(double[][] data2){
		cmdata = new CovMatrixData(data2);
		double[][] covm = cmdata.getCovMatrix();
		TableSaver.createMatrixTab(covertD2F(covm));
		
		TableSaver.saveMatrix(covertD2F(covm));
	}
// sorted series data -- data[i] is the serie of namespace no. i  in table "namespace0"
	static double[][] sortSeries(double[][] data, String[] nslist){
		double[][] data2=new double[data.length][data[0].length];
//	data[] 
		return data2;
	}
	
	public static float[][] covertD2F(double[][] d){
		float[][] f = new float[d.length][d[0].length];
		for (int i=0; i<d.length; i++)
			for(int j=0; j<d[0].length; j++){
				f[i][j]= (float)d[i][j]; 
			}
		return f;
	}
	

//
//	vt = new varTable(TableSaver.Loading());
//	vcovMatrix=TableSaver.OtoF(TableSaver.Loading())
//	vp= vt.getTable();
	
//	load double[][] data
//	build covmarix: drop,create,insert 
//  build mean, sdev table: drop, create, insert  	
}
